//
//  PlayTableViewCell.m
//  MyListenMusicFun
//
//  Created by dllo on 16/1/19.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "PlayTableViewCell.h"

@implementation PlayTableViewCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView NightWithType:UIViewColorTypeNormal];
        
        self.titleLabel = [[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor blackColor];
        _titleLabel.alpha = 0.5;
        [_titleLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_titleLabel];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont fontWithName:@"Hoefler Text" size:15];
                
        self.playtimesImg = [[UIImageView alloc] init];
//        _playtimesImg.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_playtimesImg];
        _playtimesImg.image = [UIImage imageNamed:@"playOne"];
        
        self.playtimesLabel = [[UILabel alloc] init];
//        _playtimesLabel.backgroundColor = [UIColor blueColor];
        _playtimesLabel.backgroundColor = [UIColor blackColor];
        _playtimesLabel.alpha = 0.5;
        [_playtimesLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_playtimesLabel];
        _playtimesLabel.font = [UIFont systemFontOfSize:15];
        
        self.durationImg = [[UIImageView alloc] init];
//        _durationImg.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_durationImg];
        _durationImg.image = [UIImage imageNamed:@"timeOne"];
        
        self.durationLabel = [[UILabel alloc] init];
//        _durationLabel.backgroundColor = [UIColor blueColor];
        _durationLabel.backgroundColor = [UIColor blackColor];
        _durationLabel.alpha = 0.5;
        [_durationLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_durationLabel];
        _durationLabel.font = [UIFont systemFontOfSize:15];
        
        self.commentsImg = [[UIImageView alloc] init];
//        _commentsImg.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_commentsImg];
        _commentsImg.image = [UIImage imageNamed:@"commentOne"];
        
        self.commentsLabel = [[UILabel alloc] init];
//        _commentsLabel.backgroundColor = [UIColor blueColor];
        _commentsLabel.backgroundColor = [UIColor blackColor];
        _commentsLabel.alpha = 0.5;
        [_commentsLabel NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_commentsLabel];
        _commentsLabel.font = [UIFont systemFontOfSize:15];
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    CGFloat h = [TopicTableViewCell heightWithText:_titleLabel.text width:self.contentView.frame.size.width - 20];
    _titleLabel.frame = CGRectMake(10, 5, self.contentView.frame.size.width - 20, h);
    _playtimesImg.frame = CGRectMake(10, 12.5 + h, 20, 20);
    _playtimesLabel.frame = CGRectMake(30, 10 + h, 50, 25);
    _durationImg.frame = CGRectMake(90, 12.5 + h, 20, 20);
    _durationLabel.frame = CGRectMake(110, 10 + h, 60, 25);
    _commentsImg.frame = CGRectMake(180, 12.5 + h, 20, 20);
    _commentsLabel.frame = CGRectMake(200, 10 + h, 50, 25);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
